package com.example.teamilkmall.service.Impl;

import com.example.teamilkmall.entity.AdminInfo;
import com.example.teamilkmall.entity.TeaInfo;
import com.example.teamilkmall.mapper.TeaInfoMapper;
import com.example.teamilkmall.service.TealnfoService;
import com.github.pagehelper.PageInfo;
import org.springframework.stereotype.Service;
import java.util.List;

@Service
public class TealnfoServiceImpl implements TealnfoService {

    private final TeaInfoMapper  teaInfoMapper;

    public TealnfoServiceImpl(TeaInfoMapper teaInfoMapper) {
        this.teaInfoMapper = teaInfoMapper;
    }



    @Override
    public PageInfo<TeaInfo> listTeainfo(Integer pageSize, Integer pageNum, String name) {
        List<TeaInfo> list = teaInfoMapper.listTeainfo(pageSize,pageNum,name);
        PageInfo<TeaInfo> pageInfo = new PageInfo<>(list);
        return pageInfo;
    }

    @Override
    public List<TeaInfo> listTeainfo() {
        return teaInfoMapper.listTeainfoAll();
    }

    @Override
    public void updateTea(TeaInfo teaInfo) {
        teaInfoMapper.updateTeaInfo(teaInfo);
    }

    @Override
    public void deloneTea(Integer id) {
        teaInfoMapper.deloneTeaInfo(id);
    }

    @Override
    public void addTea(TeaInfo teaInfo) {
        teaInfoMapper.addTeaInfo(teaInfo);
    }
}
